#pragma once

#include "impl.hpp"
#include <mapbox/eternal.hpp>

namespace krbn {
namespace momentary_switch_event_details {
namespace pointing_button {
constexpr std::pair<const mapbox::eternal::string, const pqrs::hid::usage::value_t> name_value_pairs[] = {
    {"button1", pqrs::hid::usage::button::button_1},
    {"button2", pqrs::hid::usage::button::button_2},
    {"button3", pqrs::hid::usage::button::button_3},
    {"button4", pqrs::hid::usage::button::button_4},
    {"button5", pqrs::hid::usage::button::button_5},
    {"button6", pqrs::hid::usage::button::button_6},
    {"button7", pqrs::hid::usage::button::button_7},
    {"button8", pqrs::hid::usage::button::button_8},
    {"button9", pqrs::hid::usage::button::button_9},
    {"button10", pqrs::hid::usage::button::button_10},
    {"button11", pqrs::hid::usage::button::button_11},
    {"button12", pqrs::hid::usage::button::button_12},
    {"button13", pqrs::hid::usage::button::button_13},
    {"button14", pqrs::hid::usage::button::button_14},
    {"button15", pqrs::hid::usage::button::button_15},
    {"button16", pqrs::hid::usage::button::button_16},
    {"button17", pqrs::hid::usage::button::button_17},
    {"button18", pqrs::hid::usage::button::button_18},
    {"button19", pqrs::hid::usage::button::button_19},
    {"button20", pqrs::hid::usage::button::button_20},
    {"button21", pqrs::hid::usage::button::button_21},
    {"button22", pqrs::hid::usage::button::button_22},
    {"button23", pqrs::hid::usage::button::button_23},
    {"button24", pqrs::hid::usage::button::button_24},
    {"button25", pqrs::hid::usage::button::button_25},
    {"button26", pqrs::hid::usage::button::button_26},
    {"button27", pqrs::hid::usage::button::button_27},
    {"button28", pqrs::hid::usage::button::button_28},
    {"button29", pqrs::hid::usage::button::button_29},
    {"button30", pqrs::hid::usage::button::button_30},
    {"button31", pqrs::hid::usage::button::button_31},
    {"button32", pqrs::hid::usage::button::button_32},
    {"button33", pqrs::hid::usage::button::button_33},
    {"button34", pqrs::hid::usage::button::button_34},
    {"button35", pqrs::hid::usage::button::button_35},
    {"button36", pqrs::hid::usage::button::button_36},
    {"button37", pqrs::hid::usage::button::button_37},
    {"button38", pqrs::hid::usage::button::button_38},
    {"button39", pqrs::hid::usage::button::button_39},
    {"button40", pqrs::hid::usage::button::button_40},
    {"button41", pqrs::hid::usage::button::button_41},
    {"button42", pqrs::hid::usage::button::button_42},
    {"button43", pqrs::hid::usage::button::button_43},
    {"button44", pqrs::hid::usage::button::button_44},
    {"button45", pqrs::hid::usage::button::button_45},
    {"button46", pqrs::hid::usage::button::button_46},
    {"button47", pqrs::hid::usage::button::button_47},
    {"button48", pqrs::hid::usage::button::button_48},
    {"button49", pqrs::hid::usage::button::button_49},
    {"button50", pqrs::hid::usage::button::button_50},
    {"button51", pqrs::hid::usage::button::button_51},
    {"button52", pqrs::hid::usage::button::button_52},
    {"button53", pqrs::hid::usage::button::button_53},
    {"button54", pqrs::hid::usage::button::button_54},
    {"button55", pqrs::hid::usage::button::button_55},
    {"button56", pqrs::hid::usage::button::button_56},
    {"button57", pqrs::hid::usage::button::button_57},
    {"button58", pqrs::hid::usage::button::button_58},
    {"button59", pqrs::hid::usage::button::button_59},
    {"button60", pqrs::hid::usage::button::button_60},
    {"button61", pqrs::hid::usage::button::button_61},
    {"button62", pqrs::hid::usage::button::button_62},
    {"button63", pqrs::hid::usage::button::button_63},
    {"button64", pqrs::hid::usage::button::button_64},
    {"button65", pqrs::hid::usage::button::button_65},
    {"button66", pqrs::hid::usage::button::button_66},
    {"button67", pqrs::hid::usage::button::button_67},
    {"button68", pqrs::hid::usage::button::button_68},
    {"button69", pqrs::hid::usage::button::button_69},
    {"button70", pqrs::hid::usage::button::button_70},
    {"button71", pqrs::hid::usage::button::button_71},
    {"button72", pqrs::hid::usage::button::button_72},
    {"button73", pqrs::hid::usage::button::button_73},
    {"button74", pqrs::hid::usage::button::button_74},
    {"button75", pqrs::hid::usage::button::button_75},
    {"button76", pqrs::hid::usage::button::button_76},
    {"button77", pqrs::hid::usage::button::button_77},
    {"button78", pqrs::hid::usage::button::button_78},
    {"button79", pqrs::hid::usage::button::button_79},
    {"button80", pqrs::hid::usage::button::button_80},
    {"button81", pqrs::hid::usage::button::button_81},
    {"button82", pqrs::hid::usage::button::button_82},
    {"button83", pqrs::hid::usage::button::button_83},
    {"button84", pqrs::hid::usage::button::button_84},
    {"button85", pqrs::hid::usage::button::button_85},
    {"button86", pqrs::hid::usage::button::button_86},
    {"button87", pqrs::hid::usage::button::button_87},
    {"button88", pqrs::hid::usage::button::button_88},
    {"button89", pqrs::hid::usage::button::button_89},
    {"button90", pqrs::hid::usage::button::button_90},
    {"button91", pqrs::hid::usage::button::button_91},
    {"button92", pqrs::hid::usage::button::button_92},
    {"button93", pqrs::hid::usage::button::button_93},
    {"button94", pqrs::hid::usage::button::button_94},
    {"button95", pqrs::hid::usage::button::button_95},
    {"button96", pqrs::hid::usage::button::button_96},
    {"button97", pqrs::hid::usage::button::button_97},
    {"button98", pqrs::hid::usage::button::button_98},
    {"button99", pqrs::hid::usage::button::button_99},
    {"button100", pqrs::hid::usage::button::button_100},
    {"button101", pqrs::hid::usage::button::button_101},
    {"button102", pqrs::hid::usage::button::button_102},
    {"button103", pqrs::hid::usage::button::button_103},
    {"button104", pqrs::hid::usage::button::button_104},
    {"button105", pqrs::hid::usage::button::button_105},
    {"button106", pqrs::hid::usage::button::button_106},
    {"button107", pqrs::hid::usage::button::button_107},
    {"button108", pqrs::hid::usage::button::button_108},
    {"button109", pqrs::hid::usage::button::button_109},
    {"button110", pqrs::hid::usage::button::button_110},
    {"button111", pqrs::hid::usage::button::button_111},
    {"button112", pqrs::hid::usage::button::button_112},
    {"button113", pqrs::hid::usage::button::button_113},
    {"button114", pqrs::hid::usage::button::button_114},
    {"button115", pqrs::hid::usage::button::button_115},
    {"button116", pqrs::hid::usage::button::button_116},
    {"button117", pqrs::hid::usage::button::button_117},
    {"button118", pqrs::hid::usage::button::button_118},
    {"button119", pqrs::hid::usage::button::button_119},
    {"button120", pqrs::hid::usage::button::button_120},
    {"button121", pqrs::hid::usage::button::button_121},
    {"button122", pqrs::hid::usage::button::button_122},
    {"button123", pqrs::hid::usage::button::button_123},
    {"button124", pqrs::hid::usage::button::button_124},
    {"button125", pqrs::hid::usage::button::button_125},
    {"button126", pqrs::hid::usage::button::button_126},
    {"button127", pqrs::hid::usage::button::button_127},
    {"button128", pqrs::hid::usage::button::button_128},
    {"button129", pqrs::hid::usage::button::button_129},
    {"button130", pqrs::hid::usage::button::button_130},
    {"button131", pqrs::hid::usage::button::button_131},
    {"button132", pqrs::hid::usage::button::button_132},
    {"button133", pqrs::hid::usage::button::button_133},
    {"button134", pqrs::hid::usage::button::button_134},
    {"button135", pqrs::hid::usage::button::button_135},
    {"button136", pqrs::hid::usage::button::button_136},
    {"button137", pqrs::hid::usage::button::button_137},
    {"button138", pqrs::hid::usage::button::button_138},
    {"button139", pqrs::hid::usage::button::button_139},
    {"button140", pqrs::hid::usage::button::button_140},
    {"button141", pqrs::hid::usage::button::button_141},
    {"button142", pqrs::hid::usage::button::button_142},
    {"button143", pqrs::hid::usage::button::button_143},
    {"button144", pqrs::hid::usage::button::button_144},
    {"button145", pqrs::hid::usage::button::button_145},
    {"button146", pqrs::hid::usage::button::button_146},
    {"button147", pqrs::hid::usage::button::button_147},
    {"button148", pqrs::hid::usage::button::button_148},
    {"button149", pqrs::hid::usage::button::button_149},
    {"button150", pqrs::hid::usage::button::button_150},
    {"button151", pqrs::hid::usage::button::button_151},
    {"button152", pqrs::hid::usage::button::button_152},
    {"button153", pqrs::hid::usage::button::button_153},
    {"button154", pqrs::hid::usage::button::button_154},
    {"button155", pqrs::hid::usage::button::button_155},
    {"button156", pqrs::hid::usage::button::button_156},
    {"button157", pqrs::hid::usage::button::button_157},
    {"button158", pqrs::hid::usage::button::button_158},
    {"button159", pqrs::hid::usage::button::button_159},
    {"button160", pqrs::hid::usage::button::button_160},
    {"button161", pqrs::hid::usage::button::button_161},
    {"button162", pqrs::hid::usage::button::button_162},
    {"button163", pqrs::hid::usage::button::button_163},
    {"button164", pqrs::hid::usage::button::button_164},
    {"button165", pqrs::hid::usage::button::button_165},
    {"button166", pqrs::hid::usage::button::button_166},
    {"button167", pqrs::hid::usage::button::button_167},
    {"button168", pqrs::hid::usage::button::button_168},
    {"button169", pqrs::hid::usage::button::button_169},
    {"button170", pqrs::hid::usage::button::button_170},
    {"button171", pqrs::hid::usage::button::button_171},
    {"button172", pqrs::hid::usage::button::button_172},
    {"button173", pqrs::hid::usage::button::button_173},
    {"button174", pqrs::hid::usage::button::button_174},
    {"button175", pqrs::hid::usage::button::button_175},
    {"button176", pqrs::hid::usage::button::button_176},
    {"button177", pqrs::hid::usage::button::button_177},
    {"button178", pqrs::hid::usage::button::button_178},
    {"button179", pqrs::hid::usage::button::button_179},
    {"button180", pqrs::hid::usage::button::button_180},
    {"button181", pqrs::hid::usage::button::button_181},
    {"button182", pqrs::hid::usage::button::button_182},
    {"button183", pqrs::hid::usage::button::button_183},
    {"button184", pqrs::hid::usage::button::button_184},
    {"button185", pqrs::hid::usage::button::button_185},
    {"button186", pqrs::hid::usage::button::button_186},
    {"button187", pqrs::hid::usage::button::button_187},
    {"button188", pqrs::hid::usage::button::button_188},
    {"button189", pqrs::hid::usage::button::button_189},
    {"button190", pqrs::hid::usage::button::button_190},
    {"button191", pqrs::hid::usage::button::button_191},
    {"button192", pqrs::hid::usage::button::button_192},
    {"button193", pqrs::hid::usage::button::button_193},
    {"button194", pqrs::hid::usage::button::button_194},
    {"button195", pqrs::hid::usage::button::button_195},
    {"button196", pqrs::hid::usage::button::button_196},
    {"button197", pqrs::hid::usage::button::button_197},
    {"button198", pqrs::hid::usage::button::button_198},
    {"button199", pqrs::hid::usage::button::button_199},
    {"button200", pqrs::hid::usage::button::button_200},
    {"button201", pqrs::hid::usage::button::button_201},
    {"button202", pqrs::hid::usage::button::button_202},
    {"button203", pqrs::hid::usage::button::button_203},
    {"button204", pqrs::hid::usage::button::button_204},
    {"button205", pqrs::hid::usage::button::button_205},
    {"button206", pqrs::hid::usage::button::button_206},
    {"button207", pqrs::hid::usage::button::button_207},
    {"button208", pqrs::hid::usage::button::button_208},
    {"button209", pqrs::hid::usage::button::button_209},
    {"button210", pqrs::hid::usage::button::button_210},
    {"button211", pqrs::hid::usage::button::button_211},
    {"button212", pqrs::hid::usage::button::button_212},
    {"button213", pqrs::hid::usage::button::button_213},
    {"button214", pqrs::hid::usage::button::button_214},
    {"button215", pqrs::hid::usage::button::button_215},
    {"button216", pqrs::hid::usage::button::button_216},
    {"button217", pqrs::hid::usage::button::button_217},
    {"button218", pqrs::hid::usage::button::button_218},
    {"button219", pqrs::hid::usage::button::button_219},
    {"button220", pqrs::hid::usage::button::button_220},
    {"button221", pqrs::hid::usage::button::button_221},
    {"button222", pqrs::hid::usage::button::button_222},
    {"button223", pqrs::hid::usage::button::button_223},
    {"button224", pqrs::hid::usage::button::button_224},
    {"button225", pqrs::hid::usage::button::button_225},
    {"button226", pqrs::hid::usage::button::button_226},
    {"button227", pqrs::hid::usage::button::button_227},
    {"button228", pqrs::hid::usage::button::button_228},
    {"button229", pqrs::hid::usage::button::button_229},
    {"button230", pqrs::hid::usage::button::button_230},
    {"button231", pqrs::hid::usage::button::button_231},
    {"button232", pqrs::hid::usage::button::button_232},
    {"button233", pqrs::hid::usage::button::button_233},
    {"button234", pqrs::hid::usage::button::button_234},
    {"button235", pqrs::hid::usage::button::button_235},
    {"button236", pqrs::hid::usage::button::button_236},
    {"button237", pqrs::hid::usage::button::button_237},
    {"button238", pqrs::hid::usage::button::button_238},
    {"button239", pqrs::hid::usage::button::button_239},
    {"button240", pqrs::hid::usage::button::button_240},
    {"button241", pqrs::hid::usage::button::button_241},
    {"button242", pqrs::hid::usage::button::button_242},
    {"button243", pqrs::hid::usage::button::button_243},
    {"button244", pqrs::hid::usage::button::button_244},
    {"button245", pqrs::hid::usage::button::button_245},
    {"button246", pqrs::hid::usage::button::button_246},
    {"button247", pqrs::hid::usage::button::button_247},
    {"button248", pqrs::hid::usage::button::button_248},
    {"button249", pqrs::hid::usage::button::button_249},
    {"button250", pqrs::hid::usage::button::button_250},
    {"button251", pqrs::hid::usage::button::button_251},
    {"button252", pqrs::hid::usage::button::button_252},
    {"button253", pqrs::hid::usage::button::button_253},
    {"button254", pqrs::hid::usage::button::button_254},
    {"button255", pqrs::hid::usage::button::button_255},
};

constexpr auto name_value_map = mapbox::eternal::hash_map<mapbox::eternal::string, pqrs::hid::usage::value_t>(name_value_pairs);

inline bool target(pqrs::hid::usage_page::value_t usage_page,
                   pqrs::hid::usage::value_t usage) {
  if (usage_page == pqrs::hid::usage_page::button) {
    return true;
  }

  return false;
}

inline std::string make_name(pqrs::hid::usage::value_t usage) {
  return impl::make_name(name_value_pairs, usage);
}

inline pqrs::hid::usage_pair make_usage_pair(const std::string& key,
                                             const nlohmann::json& json) {
  return impl::make_usage_pair(name_value_map,
                               pqrs::hid::usage_page::button,
                               key,
                               json);
}
} // namespace pointing_button
} // namespace momentary_switch_event_details
} // namespace krbn
